Developer Documentation

QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Accessing Image Buffers

The QuickTime VR Manager provides functions that you can use to access the two internal buffers used by QuickTime VR when it's imaging a panorama.

QTVRSetPrescreenImagingCompleteProc

You can use the QTVRSetPrescreenImagingCompleteProc function to install or remove a prescreen buffer imaging completion procedure.

OSErr QTVRSetPrescreenImagingCompleteProc (
                     QTVRInstanceqtvr,
                     ImagingCompleteUPPimagingCompleteProc,
                     SInt32refCon,
                     UInt32 flags);
qtvr
An instance of a QuickTime VR movie.
imagingCompleteProc
A universal procedure pointer for a prescreen buffer imaging completion procedure. See "MyImagingCompleteProc" for information about prescreen buffer imaging completion procedures.
refCon
A reference constant. This value is passed to the specified prescreen buffer imaging completion procedure.
flags
You can use kQTVRPreScreenEveryIdle to cause a draw attempt on every idle passed to the movie controller. See "Flags Value for Imaging Completion Procedure" .
function result
A result code.

DESCRIPTION

The QTVRSetPrescreenImagingCompleteProc function installs the procedure specified by the imagingCompleteProc parameter as a prescreen buffer imaging completion procedure for the QuickTime VR movie specified by the qtvr parameter. Your procedure is called whenever QuickTime VR finishes drawing an image into the prescreen buffer. The reference constant specified by the refCon parameter is passed unchanged to that prescreen buffer imaging completion procedure.

To remove a previously installed prescreen buffer imaging completion procedure, set imagingCompleteProc to nil .

SPECIAL CONSIDERATIONS

QTVRSetPrescreenImagingCompleteProc is valid only for panoramic nodes.

SEE ALSO

Use QTVRSetBackBufferImagingProc (next) to install or remove a back buffer imaging procedure.

QTVRSetBackBufferImagingProc

You can use the QTVRSetBackBufferImagingProc function to install or remove a back buffer imaging procedure.

OSErr QTVRSetBackBufferImagingProc (
                     QTVRInstance qtvr,
                     BackBufferImagingUPP backBufferImagingProc,
                     UInt16 numAreas,
                     AreaOfInterest *areasOfInterest,
                     SInt32 refCon);
qtvr
An instance of a QuickTime VR movie.
backBufferImagingProc
A universal procedure pointer for a back buffer imaging procedure. See "MyBackBufferImagingProc" for information about back buffer imaging procedures.
numAreas
The number of area of interest structures in the array pointed to by the areasOfInterest parameter.
areasOfInterest
A pointer to an array of area of interest structures. See "Area of Interest Structure" .
refCon
A reference constant. This value is passed to the specified back buffer imaging procedure.
function result
A result code.

DESCRIPTION

The QTVRSetBackBufferImagingProc function installs the procedure specified by the backBufferImagingProc parameter as a back buffer imaging procedure for the panoramic node specified by the qtvr parameter. You can use that procedure to draw directly into the back buffer.

The areasOfInterest parameter is a pointer to an array of area of interest structures that define the rectangular areas about which you want your back buffer imaging procedure to be notified. Your procedure is called for each area of interest as it becomes visible or not visible. You indicate when you want your procedure to be called for a particular area of interest by setting flags in the flags field in the corresponding area of interest structure.

The QuickTime VR Manager version 2.1 supports only one area of interest in this array. Future versions will support multiple areas of interest.

Note that coordinates in the back buffer are dependent on the current correction mode; as a result, you need to indicate the area you're interested in drawing into by specifying a pan angle and tilt angle to determine the upper-left corner of the area and a height and width relative to that corner. (Specifying a height and width instead of a second pair of pan and tilt angles for the bottom-right coordinate allows the rectangle to wrap around the edge of the panorama.)

The width of the area of interest is limited by the size of the back buffer. If the back buffer is less than the full cache size, then the area of interest can be no wider than half the size of the back buffer. (For vertical cylinder geometries, limiting factor would be the height of the buffer.) For a full cache back buffer, the width of the area of interest can be the full size of the buffer. If the width limit is exceeded, QTVRSetBackBufferImagingProc will return constraintReachedErr .

To remove a previously installed back buffer imaging procedure, set backBufferImagingProc to nil .

SPECIAL CONSIDERATIONS

QTVRSetBackBufferImagingProc is valid only for panoramic nodes.

SEE ALSO

Use QTVRSetPrescreenImagingCompleteProc to install or remove a prescreen buffer imaging completion procedure.

QTVRRefreshBackBuffer

You can use the QTVRRefreshBackBuffer function to refresh the back buffer.

OSErr QTVRRefreshBackBuffer (QTVRInstance qtvr, UInt32 flags);
qtvr
An instance of a QuickTime VR movie.
flags
Unused. Set this parameter to 0.
function result
A result code.

DESCRIPTION

The QTVRRefreshBackBuffer function refreshes some or all of the back buffer associated with the QuickTime VR movie specified by the qtvr parameter by reloading the appropriate data from the diced frames in the panorama image track.

You can call QTVRRefreshBackBuffer either in a back buffer imaging procedure or elsewhere in your application. If you call QTVRRefreshBackBuffer in a back buffer imaging procedure, only the current rectangle (that is, the rectangle specified by the procedure's drawRect parameter) is refreshed. If you call QTVRRefreshBackBuffer outside of a back buffer imaging procedure, all areas of interest specified in the most recent call to QTVRSetBackBufferImagingProc are refreshed.

SPECIAL CONSIDERATIONS

QTVRRefreshBackBuffer is valid only for panoramic nodes.

SEE ALSO

See "MyBackBufferImagingProc" for information about back buffer imaging procedures.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |